from django.contrib import admin
from .models import *


class ProductInline(admin.TabularInline):
    model = Product


@admin.register(ProductFolder)
class ProductFolderAdmin(admin.ModelAdmin):
    inlines = [ProductInline,]
    pass


@admin.register(Product)
class ProductAdmin(admin.ModelAdmin):
    fields = ('name', 'description', 'enabled', 'folder', 'price', 'price_overseas_percent', 'price_rising', 'price_min', 'price_min_date',
    'loan_allowed', 'remind_to_pay', 'remind_to_pay_interval', 'course_to_bind', 'integration_id', 'payment_successful_url',
    'payment_unsuccessful_url', 'payment_successful_email_custom', 'payment_successful_email_subject', 'payment_successful_email_body',
    'subscription_lists', 'created', 'updated')
    readonly_fields=('created', 'updated')

@admin.register(Client)
class ClientAdmin(admin.ModelAdmin):
    fields = ('name', 'surname', 'lastname', 'email', 'phone', 'ban', 'ban_description', 'created', 'updated')
    readonly_fields=('created', 'updated')


@admin.register(PaymentGate)
class PaymentGateAdmin(admin.ModelAdmin):
    pass


@admin.register(Order)
class OrderAdmin(admin.ModelAdmin):
    pass


@admin.register(LeadSource)
class LeadSourceAdmin(admin.ModelAdmin):
    pass

